package com.wu.shop.module.home.ui.adapter

import android.content.Context
import com.bumptech.glide.Glide
import com.google.android.material.imageview.ShapeableImageView
import com.wu.shop.R
import com.wu.shop.module.home.frame.model.GoodsDescInfo
import com.zhpan.bannerview.BaseBannerAdapter
import com.zhpan.bannerview.BaseViewHolder


/**
 * @author wkq
 *
 * @date 2021年07月09日 10:40
 *
 *@des
 *
 */

class HomeTopBannerAdapter(conetxt:Context) : BaseBannerAdapter<GoodsDescInfo>() {
    var mContext:Context?=null
    init {
        mContext=conetxt
    }
    override fun getLayoutId(viewType: Int): Int {
       return R.layout.item_home_top_banner
    }

    override fun bindData(
        holder: BaseViewHolder<GoodsDescInfo>?,
        data: GoodsDescInfo?,
        position: Int,
        pageSize: Int
    ) {
      var imgview=  holder!!.findViewById<ShapeableImageView>(R.id.iv_goods);
        Glide.with(mContext!!).load(data!!.goodsIcon).into(imgview)
    }


}